
const defaultColors = ['#409EFF', '#67C23A', '#E6A23C', '#F56C6C', '#909399', '#303133', '#606266', '#C0C4CC', '#DCDFE6', '#E4E7ED', '#EBEEF5', '#F2F6FC', '#000000', '#FFFFFF']

// rate
export const rateProperties = [
    {
        model: 'ui.max',
        widget: 'inputNumber',
        label: '最大分值',
        ui: {
            placeholder: '请输入最大分值',
            min: 0,
            max: 99999999,
            precision: 0,
            controlsPosition: 'right',
            style: {
                width: '100%'
            }
        }
    },
    {
        model: 'ui.lowThreshold',
        widget: 'inputNumber',
        label: '低中分界线',
        ui: {
            placeholder: '请输入低中分界线',
            min: 0,
            max: 99999999,
            step: 0.5,
            stepStrictly: true,
            precision: 1,
            controlsPosition: 'right',
            style: {
                width: '100%'
            }
        }
    },
    {
        model: 'ui.highThreshold',
        widget: 'inputNumber',
        label: '中高分界线',
        ui: {
            placeholder: '请输入中高分界线',
            min: 0,
            max: 99999999,
            step: 0.5,
            stepStrictly: true,
            precision: 1,
            controlsPosition: 'right',
            style: {
                width: '100%'
            }
        }
    },
    {
        model: 'ui.colors[0]',
        widget: 'colorPicker',
        label: '低分时颜色',
        enum: [...defaultColors]
    },
    {
        model: 'ui.colors[1]',
        widget: 'colorPicker',
        label: '中分时颜色',
        enum: [...defaultColors]
    },
    {
        model: 'ui.colors[2]',
        widget: 'colorPicker',
        label: '高分时颜色',
        enum: [...defaultColors]
    },
    {
        model: 'ui.voidColor',
        widget: 'colorPicker',
        label: '未选中的颜色',
        enum: [...defaultColors]
    },
    {
        model: 'ui.disabledVoidColor',
        widget: 'colorPicker',
        label: '禁用时未选中的颜色',
        enum: [...defaultColors]
    },
    {
        model: 'ui.allowHalf',
        widget: 'switch',
        label: '允许半选'
    },
    {
        model: 'ui.showScore',
        widget: 'switch',
        label: '显示当前分数'
    },
    {
        model: 'ui.showText',
        widget: 'switch',
        label: '显示辅助文字'
    },
    {
        model: 'ui.texts[0]',
        widget: 'input',
        label: '辅助文字',
        ui: {
            placeholder: '请输入辅助文字',
            maxlength: 200
        },
        if (model) {
            return model && model.ui && model.ui.showText
        }
    },
    {
        model: 'ui.texts[1]',
        widget: 'input',
        label: '',
        ui: {
            placeholder: '请输入辅助文字',
            maxlength: 200
        },
        if (model) {
            return model && model.ui && model.ui.showText
        }
    },
    {
        model: 'ui.texts[2]',
        widget: 'input',
        label: '',
        ui: {
            placeholder: '请输入辅助文字',
            maxlength: 200
        },
        if (model) {
            return model && model.ui && model.ui.showText
        }
    },
    {
        model: 'ui.texts[3]',
        widget: 'input',
        label: '',
        ui: {
            placeholder: '请输入辅助文字',
            maxlength: 200
        },
        if (model) {
            return model && model.ui && model.ui.showText
        }
    },
    {
        model: 'ui.texts[4]',
        widget: 'input',
        label: '',
        ui: {
            placeholder: '请输入辅助文字',
            maxlength: 200
        },
        if (model) {
            return model && model.ui && model.ui.showText
        }
    },
    {
        model: 'ui.textColor',
        widget: 'colorPicker',
        label: '辅助文字颜色',
        enum: [...defaultColors],
        if (model) {
            return model && model.ui && (model.ui.showScore || model.ui.showText)
        }
    }
]
